<!doctype html>
<html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false"%>
<head>
    <title>多车视频监控</title>
    <%@ include file="videoHead.jsp"%>
</head>
<body class="videoMulti">
<div class="height100">
	<div class="height100 width50 fl">
		<div class="height50 overhidden" style="border-style:double;border-color:#666;">
			<iframe frameborder="1" width="100%" height="100%" src="" scrolling="no" id="ltiframe"></iframe> 
		</div>
		<div class="height50 overhidden" style="border-style:double;border-color:#666;">
			<iframe frameborder="1" width="100%" height="100%" src="" scrolling="no" id="ldiframe"></iframe> 
		</div>
	</div>
	<div class="height100 width50 fl ">
		<div class="height50 overhidden" style="border-style:double;border-color:#666;">
			<iframe frameborder="1" width="100%" height="100%" src="" scrolling="no" id="rtiframe"></iframe> 
		</div>
		<div class="height50 overhidden" style="border-style:double;border-color:#666;">
			<iframe frameborder="1" width="100%" height="100%" src="" scrolling="no" id="rdiframe"></iframe> 
		</div>
	</div>
</div>
<div style="height:0px;position:fixed;top:7px">
	<object id="IScanClientOCXCtrl_Main_4" style="width:100%; height:100% ;"  codebase="download/IScanClientOCX.exe" classid="clsid:455FA7A9-756E-4767-8A0A-40DDECD23659">
							<a class="videoBtn" href="${ocxPath}OcxHD.exe" id="downloadVideoControl">下载视频控件</a>
	</object>
</div>
<script>
var vehicleID1 ="${vehicleID1}";	
var vehicleID2 ="${vehicleID2}";	
var vehicleID3 ="${vehicleID3}";	
var vehicleID4 ="${vehicleID4}";	

var commno1 ="";
var commno2 ="";
var commno3 ="";
var commno4 ="";
var  appCtx="${appCtx}";

IScanClientOCXCtrlParam = function(){ 
    return {
        resultInitial:null,
        resultLogin:null,
        curPresetControl : -1, 
        talkCtrl : null,//已打开对讲的设备信息,
		talkDevAddr: null, // 已打开对讲设备地址
		talkDevName: null, // 已打开对讲设备名
        deviceAddress:null,//设备地址
        devName:null,
        state:false,//判断是否已经登录
        picturePath : 'D:\\iscanPicture\\',
        vedioPath : 'D:\\iscanVedio\\',
        destroy : function(){
            this.talkCtrl = null;
            this.deviceAddress = null;
            this.state = null;
            this.picturePath = IScanClientOCXCtrlParam.picturePath;
            this.vedioPath = IScanClientOCXCtrlParam.vedioPath;
			this.talkDevAddr = null;
			this.talkDevName = null;
        }
    }
}();

$(function(){ 
	try{
		$("#ltiframe").attr("src", appCtx + "/video/videoMonitorMin.html?vehicleID="+vehicleID1+"&position=1");
		$("#rtiframe").attr("src", appCtx + "/video/videoMonitorMin.html?vehicleID="+vehicleID2+"&position=2");
		$("#ldiframe").attr("src", appCtx + "/video/videoMonitorMin.html?vehicleID="+vehicleID3+"&position=3");
		$("#rdiframe").attr("src", appCtx + "/video/videoMonitorMin.html?vehicleID="+vehicleID4+"&position=4");
		login();
	}catch(e){
		  
	}
});


//登录
function login(){ 
    if(IScanClientOCXCtrlParam.state){
        alert("请退出系统再重新登录");
        return;
    }
    var user = 'kljk';
    var password = '123456';
    var ip = '58.67.161.51';
    var port = 52460;
   
    if(!user||!password||!ip||!port){
        alert('用户名、密码、ip或端口号为空');
        return;
    }
	var nettype = 3;
    var resultInitial = IScanClientOCXCtrl_Main_4.CX_InitialEx(ip, parseInt(port), 1 , 0 , nettype , 0);

	//默认增加一个播放标识
	$("#IScanClientOCXCtrl_Main_4").attr('realplay' , 'false');

    if(0 != resultInitial){
        return;
    }
    var resultLogin = IScanClientOCXCtrl_Main_4.CX_Login(user, password);
	if(resultLogin == 0){
       IScanClientOCXCtrlParam.state = true;
	}else{
	}
    IScanClientOCXCtrlParam.resultInitial = resultInitial;
    IScanClientOCXCtrlParam.resultLogin = resultLogin;
    var deviceList = IScanClientOCXCtrl_Main.CX_GetDeviceList();
}


function changeIframe(vehcileid,positionNum,commno){
	if(positionNum=="1"){
		vehicleID1 =vehcileid;
		commno1=commno;
		$("#ltiframe").attr("src", appCtx + "/video/videoMonitorMin.html?vehicleID="+vehcileid+"&position=1");	
	}
   	if(positionNum=="2"){
   		vehicleID2 =vehcileid;
   		commno2=commno;
   		$("#rtiframe").attr("src", appCtx + "/video/videoMonitorMin.html?vehicleID="+vehcileid+"&position=2");
	}
	if(positionNum=="3"){
		vehicleID3 =vehcileid;
		commno3=commno;
		$("#ldiframe").attr("src", appCtx + "/video/videoMonitorMin.html?vehicleID="+vehcileid+"&position=3");
	}
	if(positionNum=="4"){
		vehicleID4 =vehcileid;
		commno4=commno;
		$("#rdiframe").attr("src", appCtx + "/video/videoMonitorMin.html?vehicleID="+vehcileid+"&position=4");
	}
}
</script>
</body>
</html>